package com.example.filecabinet.util;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.example.filecabinet.dto.GeneralUserInfo;
import com.example.filecabinet.dto.StaffMemberInfo;
import com.example.filecabinet.dto.resp.GeneralUserQueryResp;
import com.example.filecabinet.dto.resp.StaffMemberQueryResp;
import com.example.filecabinet.entity.Lattice_info;
import com.thfdcsoft.framework.common.http.dto.BaseHttpRspn;
import com.thfdcsoft.framework.common.json.jackson.JacksonFactory;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;

import javax.sound.midi.Soundbank;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.util.*;
import java.util.stream.Collectors;

public class Test {
    /**
     * 工作人员查询不动产中心接口
     */

    //获取工作人员查询接口
    @Value("${staffMemberQueryUrl}")
    private String queryUrl;


//    public static void main(String[] args) {
//        //正式环境
////        String json = Http.sendPost("", "");
//
//
//        //测试数据
//        String testJson = "{\"code\":\"1\",\"message\":\"\",\"data\":{\"businessNumber\":\"213123123123\",\"businessType\":\"1\",\"userName\":\"张三\",\"userNumber\":\"420622198003294839\",\"userTel:\":\"13098451801\"}}";
//        StaffMemberQueryResp staffMemberQueryResp = JacksonFactory.readJson(testJson, StaffMemberQueryResp.class);
//        //封装返回对象
//        BaseHttpRspn result = new BaseHttpRspn(false);
//        if (staffMemberQueryResp.getCode()=="1"||staffMemberQueryResp.getCode().equals("1")) {
//            result.setResult(true);
//            result.setRespObj(staffMemberQueryResp.getData());
//            result.setRespMsg("接口查询成功");
//        } else {
//            result.setResult(false);
//            result.setRespObj(staffMemberQueryResp.getData());
//            result.setRespMsg("接口查询失败");
//        }
//        System.out.println(JacksonFactory.writeJson(result));
//    }

    public static void main(String[] args) {
        String sb="{latticeId='100000000001', latticeNumber='01', deviceNumber='1', plateNumber='1', businessNumber='00000000001', businessType='登记资料', latticeLdleStatus='01', latticeSwithStatus='00', latticeRemarks1='null', latticeRemarks2='null', latticeUpdateTime='2020-03-23 12:34:56', latticeOperator='01'}";
//        JSONObject parseObject = JSONObject.parseObject(json);
//        String list = parseObject.getString("Lattice_info");
//        System.out.println(list.toString());
//        Object o = new Object();
//        o="Lattice_info{latticeId='100000000001', latticeNumber='01', deviceNumber='1', plateNumber='1', businessNumber='00000000001', businessType='登记资料', latticeLdleStatus='01', latticeSwithStatus='00', latticeRemarks1='null', latticeRemarks2='null', latticeUpdateTime='2020-03-23 12:34:56', latticeOperator='01'}";
//        Lattice_info lattice_info = JSONArray.parseObject(json, Lattice_info.class);
//        String sb = "bbbdsajjds";

        Lattice_info lattice_info = JSONObject.parseObject(sb, Lattice_info.class);
        System.out.println(lattice_info.getBusinessNumber());
    }




}
